<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php
global $page, $paged; wp_title( '|', true, 'right' ); bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) echo " | $site_description";
if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
?></title>
<?php if (is_home()||is_paged()||is_front_page()){ $description = "小峰网络遨游记是一个记录80后的网络经历以及手机玩机经验的博客，同时也会分享Linux、运维、监控、PHP等相关知识。"; $keywords = "ios,android,cydia,linux,vps,wordpress,php,nginx,mysql,google,chrome,symbian,小峰"; }
elseif(is_single()){$post_content = trim(strip_tags($post->post_content)); $post_content = str_replace(array("\r\n", "\r", "\n", " "), " ", $post_content); $description = preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,0}'.'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,220}).*#s','$1',$post_content);
$keywords = ""; $tags = wp_get_post_tags($post->ID); foreach ($tags as $tag ) { $keywords = $keywords . $tag->name . ","; } if( $keywords == "" ){ $keywords = "ios,android,cydia,linux,vps,wordpress,php,nginx,mysql,google,chrome,symbian"; }
}
elseif(is_page()){ $description = "小峰网络遨游记是一个记录80后的网络经历以及手机玩机经验的博客，同时也会分享Linux、运维、监控、PHP等相关知识。"; $keywords = "ios,android,cydia,linux,vps,wordpress,php,nginx,mysql,google,chrome,symbian"; }
elseif(is_tag()||is_category()||is_search()){ $description = "小峰网络遨游记是一个记录80后的网络经历以及手机玩机经验的博客，同时也会分享Linux、运维、监控、PHP等相关知识。"; $keywords = "ios,android,cydia,linux,vps,wordpress,php,nginx,mysql,google,chrome,symbian"; }
?>
<meta name="keywords" content="<?php echo rtrim($keywords,','); ?>" />
<meta name="description" content="<?php echo $description; ?>" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="http://feeds.feedburner.com/JoysBoy" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" /> 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(
	['_setAccount', 'UA-18965227-1'],
	['_setDomainName', 'xfeng.me'],
	['_trackPageview'],
	['_trackPageLoadTime']
  );
</script>
<?php 
	if (isset($_COOKIE['__utma'])) 
	{
		$visitutma = $_COOKIE['__utma'];
		$lastlen = strrpos($visitutma,".");
		$visitcount = substr($visitutma,$lastlen+1);
	}
	if (isset($_COOKIE['__utmb'])&&isset($_COOKIE['__utmc'])) 
	{
		$visitutmb = $_COOKIE['__utmb'];
		$visitutmc = $_COOKIE['__utmc'];
		$utmclen = strlen($visitutmc);
		$countlen = strpos($visitutmb,".",$utmclen+1) - $utmclen - 1;
		$visitpagecount = substr($visitutmb,$utmclen+1,$countlen);
	}
	if (isset($_COOKIE['__utmv'])) 
	{
		$visitutmv = $_COOKIE['__utmv'];
	}
	if ($visitpagecount <= 1)
	{ ?>
		<script type="text/javascript"> _gaq.push(['_setCustomVar', 2, 'Visitor-Type', 'Visitor', 2]); </script>
	<?php }
	if ( !strpos($visitutmv,"Member") && !strpos($visitutmv,"Tourist"))
	{ ?>
		<script type="text/javascript"> _gaq.push(['_setCustomVar', 3, 'User-Type', 'Tourist', 1]); </script>
	<?php }
	elseif( $visitcount >= 20 && !strpos($visitutmv,"Member"))
	{ ?>
		<script type="text/javascript"> _gaq.push(['_setCustomVar', 3, 'User-Type', 'Member', 1]); </script>
	<?php }
	elseif (strpos($visitutmv,"Member") && $visitcount >= 50 && !strpos($visitutmv,"VIP Member"))
	{ ?>
		<script type="text/javascript"> _gaq.push(['_setCustomVar', 3, 'User-Type', 'VIP Member', 1]); </script>
	<?php }
?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/comment-style.css" type="text/css" />
<?php if (strtoupper(get_locale()) == 'JA') ://to fix the font-size for japanese font ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/japanese.css" type="text/css" />
<?php endif; ?>
<!--[if lt IE 7]>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/ie6.css" type="text/css" />
<![endif]--> 
<?php $options = get_option('mc_options'); if($options['site_width'] == '930') { ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/width_930px.css" type="text/css" />
<?php } elseif($options['site_width'] == '1100') { ; ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/width_1100px.css" type="text/css" />
<?php }; ?>
<?php if($options['image_style']) { ?>
<style type="text/css">
.post img, .post a img { border:1px solid #ccc; padding:5px; margin:0 10px 0 0;  background:#f2f2f2; }
.post a:hover img { border:1px solid #38a1e5; background:#9cd1e1; }
.post img.wp-smiley { border:0px; padding:0px; margin:0px; background:none; }
</style>
<?php }; ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.7.1.min.js"></script>
<?php wp_head(); ?>
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
<?php if (is_single()) { ?>
googletag.defineSlot('/8455635/文章结尾矩形广告位(左)', [300, 250], 'div-gpt-ad-1326261359510-1').addService(googletag.pubads());
googletag.defineSlot('/8455635/文章结尾矩形广告位(右)', [300, 250], 'div-gpt-ad-1326261359510-2').addService(googletag.pubads());
googletag.defineSlot('/8455635/文章内横幅', [468, 60], 'div-gpt-ad-1326261359510-3').addService(googletag.pubads());
<?php }; ?>
<?php if (is_page()) { ?>
googletag.defineSlot('/8455635/独立页面矩形广告位(左)', [300, 250], 'div-gpt-ad-1326261359510-4').addService(googletag.pubads());
googletag.defineSlot('/8455635/独立页面矩形广告位(右)', [300, 250], 'div-gpt-ad-1326261359510-5').addService(googletag.pubads());
googletag.defineSlot('/8455635/独立页面横幅广告', [468, 60], 'div-gpt-ad-1326261359510-6').addService(googletag.pubads());
<?php }; ?>
<?php if ((is_single()||is_page())&&comments_open()) { ?>
//googletag.defineSlot('/8455635/评论框前横幅广告位', [468, 60], 'div-gpt-ad-1326261359510-7').addService(googletag.pubads());
<?php }; ?>
googletag.defineSlot('/8455635/侧边栏广告', [200, 200], 'div-gpt-ad-1326261359510-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
 <!--[if lt IE 8]>
  <div style="border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;">
    <div style="position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;"><a href="#" onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src="http://xfeng.me/wp-content/uploads/images/noie/ie6nomore-cornerx.jpg" style="border: none;" alt="Close this notice"/></a></div>
    <div style="width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;">
      <div style="width: 75px; float: left;"><img src="http://xfeng.me/wp-content/uploads/images/noie/ie6nomore-warning.jpg" alt="Warning!"/></div>
      <div style="width: 275px; float: left; font-family: Arial, sans-serif;">
        <div style="font-size: 14px; font-weight: bold; margin-top: 12px;">您正在使用一款非常落后的浏览器！！！</div>
        <div style="font-size: 12px; margin-top: 6px; line-height: 12px;">为了给您带来更好的浏览体验，请点击右侧图标，选择一款你喜欢的浏览器。</div>
      </div>
      <div style="width: 75px; float: left;"><a href="http://www.google.com/chrome" onClick="_gaq.push(['_trackEvent', 'OutgoLink', 'Download Chrome']);" target="_blank"><img src="http://xfeng.me/wp-content/uploads/images/noie/ie6nomore-chrome.jpg" style="border: none;" alt="Google Chrome"/></a></div>
      <div style="width: 75px; float: left;"><a href="http://www.firefox.com" onClick="_gaq.push(['_trackEvent', 'OutgoLink', 'Download Firefox']);" target="_blank"><img src="http://xfeng.me/wp-content/uploads/images/noie/ie6nomore-firefox.jpg" style="border: none;" alt="Firefox"/></a></div>
      <div style="float: left;"><a href="http://www.apple.com/safari/download/" onClick="_gaq.push(['_trackEvent', 'OutgoLink', 'Download Safari']);" target="_blank"><img src="http://xfeng.me/wp-content/uploads/images/noie/ie6nomore-safari.jpg" style="border: none;" alt="Safari"/></a></div>
    </div>
  </div>
  <![endif]-->
<div id="wrapper">

 <div id="header">

  <div id="header_top">

   <div id="logo">
   <?php if ($options['use_logo']): ?>
    <h1><a href="<?php echo bloginfo('url'); ?>/" id="logo_image"><img src="<?php bloginfo('template_url'); ?>/img/<?php echo $options['logo_name']; ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" /></a></h1>
   <?php else: ?>
    <a href="<?php echo bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a>
    <h1><?php bloginfo('description'); ?></h1>
   <?php endif; ?>
   </div>

   <?php if($options['use_wp_nav_menu']) { ?>
   <?php if (function_exists('wp_nav_menu')) { wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'header_menu' ) ); }; ?>
   <?php } else { ?>
   <div class="header_menu">
    <ul class="menu">
     <li class="<?php if (!is_paged() && is_front_page()) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo bloginfo('url'); ?>/"><?php _e('HOME','monochrome'); ?></a></li>
     <?php
         if($options['header_menu_type'] == 'pages') {
         wp_list_pages('sort_column=menu_order&depth=0&title_li=&exclude=' . $options['exclude_pages']);
         } else {
         wp_list_categories('depth=0&title_li=&exclude=' . $options['exclude_category']);
         }
     ?>
    </ul>
   </div>
   <?php }; ?>

  </div>

  </div><!-- #header end -->
